/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #f0f4ff 0%, #d9e2f0 100%);
    min-height: 100vh;
    padding: 1.5rem;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 10, 30, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 60px;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: #3d4b68;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    color: #1a263b;
}

.nav-links a i {
    font-size: 1rem;
}

.nav-links a.hidden {
    display: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1rem 0.5rem 0.8rem;
    background: white;
    border-radius: 40px;
    border: 1px solid #e3eaf5;
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #b0c2dd;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2a3b5e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
    color: #1a263b;
    font-size: 0.9rem;
}

.user-type {
    font-size: 0.7rem;
    color: #6a7a9a;
    background: #eef3fc;
    padding: 0.2rem 0.6rem;
    border-radius: 40px;
    font-weight: 500;
}

.logout-btn {
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fee;
    color: #c62828;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a263b;
}

.page-title i {
    color: #4a6fa5;
    margin-right: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-refresh {
    padding: 0.7rem 1.5rem;
    background: #1a263b;
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-refresh:hover {
    background: #2f3f62;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 38, 59, 0.25);
}

.btn-refresh i {
    font-size: 1rem;
}

/* ===== TABLA ===== */
.table-container {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    padding: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 10, 30, 0.08);
    width: 100%;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-info {
    color: #6a7a9a;
    font-size: 0.9rem;
    font-weight: 500;
}

.table-info span {
    color: #1a263b;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: rgba(42, 59, 94, 0.05);
    border-radius: 1rem;
}

th {
    text-align: left;
    padding: 1rem 0.8rem;
    font-weight: 600;
    color: #1a263b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    color: #2a3b5e;
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:hover td {
    background: rgba(42, 59, 94, 0.02);
}

/* ===== BADGES ===== */
.badge-action {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-create {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-update {
    background: #e3f2fd;
    color: #0d47a1;
}

.badge-delete {
    background: #fce4ec;
    color: #c62828;
}

.badge-complete {
    background: #fff3e0;
    color: #e65100;
}

.badge-status_change {
    background: #f3e5f5;
    color: #6a1b9a;
}

.badge-password_change {
    background: #e8eaf6;
    color: #1a237e;
}

.badge-login {
    background: #e0f7fa;
    color: #00695c;
}

/* ===== ICONOS DE ACCIÓN ===== */
.action-icon {
    font-size: 1.2rem;
    margin-right: 0.3rem;
}

.action-icon.create { color: #2e7d32; }
.action-icon.update { color: #0d47a1; }
.action-icon.delete { color: #c62828; }
.action-icon.complete { color: #e65100; }
.action-icon.status_change { color: #6a1b9a; }
.action-icon.password_change { color: #1a237e; }
.action-icon.login { color: #00695c; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6a7a9a;
}

.empty-state i {
    font-size: 3rem;
    color: #dbe1ed;
    margin-bottom: 1rem;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1a263b;
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideUp 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.success {
    background: #2e7d32;
}

.toast.error {
    background: #c62828;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    body { padding: 1rem; }
    .navbar { flex-direction: column; gap: 0.8rem; padding: 0.8rem 1.2rem; border-radius: 1.5rem; width: 100%; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 0.8rem; width: 100%; }
    .nav-links a { font-size: 0.85rem; }
    .page-title { font-size: 1.3rem; }
    .page-header { flex-direction: column; align-items: stretch; }
    .header-actions { width: 100%; }
    .btn-refresh { width: 100%; justify-content: center; }
    .table-container { padding: 1rem; }
    table { font-size: 0.8rem; min-width: 600px; }
    th, td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 700px) {
    body { padding: 0.8rem; }
    .navbar { padding: 0.7rem 1rem; border-radius: 1.2rem; gap: 0.6rem; width: 100%; }
    .logo-icon { width: 48px; height: 48px; }
    .nav-links a { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
    .nav-links a i { font-size: 0.8rem; }
    .user-avatar { width: 30px; height: 30px; font-size: 0.8rem; }
    .user-name { font-size: 0.75rem; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .logout-btn { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
    .page-header { margin-bottom: 1rem; justify-content: center; text-align: center; width: 100%; }
    .page-title { font-size: 1.1rem; justify-content: center; width: 100%; }
    .page-title i { font-size: 1rem; }
    .header-actions { width: 100%; justify-content: center; }
    .btn-refresh { font-size: 0.85rem; padding: 0.6rem 1rem; width: 100%; justify-content: center; }
    .btn-refresh i { font-size: 0.9rem; }
    .table-container { padding: 0.8rem; border-radius: 1.2rem; width: 100%; }
    .table-info { font-size: 0.7rem; }
    table { font-size: 0.7rem; min-width: 500px; }
    th { font-size: 0.6rem; padding: 0.4rem 0.4rem; }
    td { font-size: 0.7rem; padding: 0.4rem 0.4rem; }
    .badge-action { font-size: 0.6rem; padding: 0.2rem 0.6rem; }
    .action-icon { font-size: 1rem; }
}

@media (max-width: 480px) {
    body { padding: 0.5rem; }
    .navbar { padding: 0.5rem 0.7rem; border-radius: 1rem; gap: 0.4rem; width: 100%; }
    .logo-icon { width: 100px; height: 40px; }
    .nav-links a { font-size: 0.65rem; padding: 0.2rem 0.4rem; }
    .nav-links a i { font-size: 0.7rem; }
    .nav-links a span { display: none; }
    .user-avatar { width: 24px; height: 24px; font-size: 0.6rem; }
    .user-name { font-size: 0.6rem; max-width: 40px; }
    .user-type { display: none; }
    .logout-btn { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
    .logout-btn span { display: none; }
    .page-title { font-size: 0.95rem; justify-content: center; }
    .page-title i { font-size: 0.85rem; }
    .btn-refresh { font-size: 0.65rem; padding: 0.4rem 0.6rem; }
    .table-container { padding: 0.6rem; border-radius: 1rem; width: 100%; }
    table { font-size: 0.6rem; min-width: 450px; }
    th { font-size: 0.55rem; padding: 0.3rem 0.3rem; }
    td { font-size: 0.6rem; padding: 0.3rem 0.3rem; }
    .badge-action { font-size: 0.55rem; padding: 0.15rem 0.4rem; }
    .action-icon { font-size: 0.9rem; margin-right: 0.15rem; }
    .empty-state { padding: 1.2rem; }
    .empty-state i { font-size: 2rem; }
    .empty-state p { font-size: 0.75rem; }
}

@media (max-width: 380px) {
    body { padding: 0.3rem; }
    table { min-width: 400px; font-size: 0.55rem; }
    th, td { padding: 0.2rem 0.2rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
    body { padding: 0.5rem; }
    .navbar { padding: 0.4rem 0.8rem; margin-bottom: 0.8rem; width: 100%; }
    .page-header { margin-bottom: 0.6rem; }
    .page-title { font-size: 1rem; }
    .table-container { padding: 0.6rem; }
    table { font-size: 0.65rem; min-width: 450px; }
}