/* =========================================
   GLOBAL DESIGN SYSTEM - GABINETE
   ========================================= */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #3498db;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --text-dark: #343a40;
    --text-muted: #6c757d;
    --border-radius-lg: 15px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* =========================================
   LAYOUT & CONTAINERS
   ========================================= */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   HEADERS
   ========================================= */

.page-header-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.page-header-gradient h1 {
    font-weight: 700;
    margin-bottom: 5px;
}

.page-header-gradient h2 {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 400;
}

.modal-header-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.modal-header-gradient .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* =========================================
   CARDS & PANELS
   ========================================= */

.card-content {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    border: none;
    transition: transform 0.2s ease;
}

.card-content.border-left-primary {
    border-left: 4px solid var(--primary-color);
}

.card-content.border-left-success {
    border-left: 4px solid var(--success-color);
}

.card-content.border-left-warning {
    border-left: 4px solid var(--warning-color);
}

/* =========================================
   TABLES
   ========================================= */

.table-modern {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 15px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
}

.table-modern thead th:first-child {
    border-top-left-radius: var(--border-radius-md);
}

.table-modern thead th:last-child {
    border-top-right-radius: var(--border-radius-md);
}

.table-modern tbody tr {
    transition: all 0.2s;
}

.table-modern tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.table-modern td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    color: var(--text-dark);
}

.table-modern td:first-child {
    border-left: 1px solid #eee;
}

.table-modern td:last-child {
    border-right: 1px solid #eee;
}

/* =========================================
   BUTTONS & BADGES
   ========================================= */

.btn-action {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
}

.btn-primary-gradient:hover,
.btn-primary-gradient:focus,
.btn-primary-gradient:active,
.btn-primary-gradient.active,
.show>.btn-primary-gradient.dropdown-toggle,
.btn-primary-gradient.dropdown-toggle.show {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white !important;
}

.badge-pill {
    padding: 0.5em 0.8em;
    border-radius: 50rem;
    font-weight: 500;
    font-size: 0.75em;
}

/* =========================================
   FORMS & INPUTS
   ========================================= */

.form-control-modern {
    border-radius: var(--border-radius-sm);
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    transition: all 0.2s;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* =========================================
   UTILITIES & PAGINATION
   ========================================= */

.pagination-modern .page-link {
    border-radius: 6px;
    margin: 0 3px;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    font-weight: 500;
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
    color: var(--primary-color);
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.sortable.active-asc::after {
    content: ' ↑';
    opacity: 0.8;
}

.sortable.active-desc::after {
    content: ' ↓';
    opacity: 0.8;
}

/* =========================================
   DROPDOWNS
   ========================================= */

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-hover);
    border-radius: var(--border-radius-md);
    background-color: #fff !important;
    /* Ensure solid white background */
    z-index: 1050;
    /* Ensure it stays on top */
}

.dropdown-item {
    padding: 8px 20px;
    transition: all 0.2s;
    color: var(--text-dark);
}

.dropdown-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.dropdown-item:active {
    background-color: var(--primary-color);
    color: white;
}