/* RESET & GLOBAL STYLES */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--single-line-body-base-font-size);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.content {
    min-height: 100dvh;
    width: 100dvw;
    background: var(--bg-color);
    overflow-x: hidden;
}

/* BUTTONS - Global button styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-family);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

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

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.btn-outline-danger {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* FORM CONTROLS - Global form styles */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--single-line-body-base-font-size);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

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

.form-select {
    @extend .form-control;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

/* CARDS - Global card styles */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 1rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

/* MODALS - Global modal styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    backdrop-filter: blur(4px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-dialog {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-dialog.modal-xl {
    max-width: 1200px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-family: var(--titulo-2-font-family);
    font-size: var(--titulo-2-font-size);
    color: var(--text-color);
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    transition: color 0.2s ease;
}

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

/* CONTAINERS - Global layout containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

.page-container {
/*    padding: 2rem;*/
/*    max-width: 1400px;*/
    margin: 0 0;
}

/* GRID SYSTEM */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col,
.col-md-6,
.col-md-4,
.col-md-3 {
    padding: 0 0.75rem;
    flex: 1;
}

.col-md-6 {
    flex: 0 0 50%;
}

.col-md-4 {
    flex: 0 0 33.333333%;
}

.col-md-3 {
    flex: 0 0 25%;
}

/* NAVIGATION STYLES */
.main-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.05);
}

.logo-container img {
    height: 60px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.nav-item {
    position: relative;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.nav-item a:hover,
.nav-item a.active {
    background-color: var(--firstcolor);
    color: var(--thirdcolor);
}

.nav-item a.active::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background-color: var(--thirdcolor);
    border-radius: 50%;
}

/* USER MENU */
.user-menu-container {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 1.5rem;
}

.user-btn:hover {
    background-color: var(--firstcolor);
    color: var(--thirdcolor);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--thirdcolor);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1055;
}

.toast {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    min-width: 300px;
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.toast-body {
    color: var(--text-muted);
}

/* LOADING STATES */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

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

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

/* EMPTY STATES */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3,
.empty-state h4 {
    font-family: var(--titulo-2-font-family);
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

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

/* FORM LAYOUTS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row > * {
    flex: 1;
}

/* VALIDATION MESSAGES */
.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.field-validation-error {
    color: #dc3545;
}

/* SEARCH COMPONENTS */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--single-line-body-base-font-size);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .container,
    .page-container {
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        flex: 1 1 100%;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .main-nav {
        display: none;
    }
    
    .header-container {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* UTILITY CLASSES */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline-block { display: inline-block; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }

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

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

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

.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--shadow); }

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-in { animation: slideIn 0.4s ease-out; }
.pulse { animation: pulse 2s infinite; }



