/* Variables globales */
:root {
    --primary-color: #4e73df;
    --secondary-color: #1cc88a;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
}

/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    display: flex;
    align-items: center;
}

.sidebar-brand img {
    height: 35px;
    margin-right: 10px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-user {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-user img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-info h4 {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}

.user-info p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.7;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 4px solid white;
}

.sidebar-nav i {
    margin-right: 10px;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav .badge {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-divider {
    height: 0;
    margin: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-heading {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 1.5rem;
    margin: 1rem 0 0.5rem;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand span, 
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .sidebar-heading {
    display: none;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 1rem;
}

.sidebar.collapsed .sidebar-user img {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-nav a {
    padding: 0.8rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-nav i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-nav .badge {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    transition: all 0.3s ease;
}

.content-wrapper {
    padding: 1.5rem;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background-color: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    transition: all 0.3s ease;
}

.header.expanded {
    left: var(--sidebar-collapsed-width);
}

.header-search {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.header-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    outline: none;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #b7b9cc;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-icon {
    position: relative;
    margin-left: 1.5rem;
    font-size: 1.2rem;
    color: var(--dark-color);
    cursor: pointer;
}

.header-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.user-menu {
    margin-left: 1.5rem;
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.35rem;
    transition: all 0.2s ease;
}

.user-menu-toggle:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

.user-menu-toggle img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #eaeaea;
    margin-right: 10px;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 200px;
    background-color: white;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: none;
    z-index: 100;
}

.user-menu-dropdown.active {
    display: block;
}

.user-menu-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--dark-color);
    font-size: 0.9rem;
    border-bottom: 1px solid #e3e6f0;
}

.user-menu-dropdown a:last-child {
    border-bottom: none;
}

.user-menu-dropdown a:hover {
    background-color: var(--light-color);
}

.user-menu-dropdown i {
    margin-right: 10px;
}

/* Cards */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.35rem;
    background-color: white;
    border: none;
}

.card-header {
    background-color: #f8f9fc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e3e6f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Botones */
.btn {
    border-radius: 0.35rem;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
}

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

.btn-success:hover {
    background-color: #17a673;
    border-color: #169b6b;
}

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

.btn-info:hover {
    background-color: #2cacaf;
    border-color: #2a96a5;
}

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

.btn-warning:hover {
    background-color: #f4b30d;
    border-color: #e9aa0b;
}

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

.btn-danger:hover {
    background-color: #e02d1b;
    border-color: #d52a1a;
}

.btn-light {
    background-color: var(--light-color);
    border-color: var(--light-color);
    color: var(--dark-color);
}

.btn-light:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

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

.btn-dark:hover {
    background-color: #42444e;
    border-color: #3d3f47;
}

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

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.35rem;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

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

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

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

.badge-light {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.badge-dark {
    background-color: var(--dark-color);
    color: white;
}

/* Tablas */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #e3e6f0;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #e3e6f0;
    background-color: #f8f9fc;
    color: #6e707e;
    font-weight: 700;
}

.table tbody + tbody {
    border-top: 2px solid #e3e6f0;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem;
}

.table-bordered {
    border: 1px solid #e3e6f0;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #e3e6f0;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6e707e;
    background-color: white;
    background-clip: padding-box;
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #6e707e;
    background-color: white;
    border-color: #bac8f3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-control::placeholder {
    color: #b7b9cc;
    opacity: 1;
}

textarea.form-control {
    height: auto;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: block;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #858796;
}

/* Dashboard específico */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: white;
    border-radius: 0.35rem;
    padding: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-primary .stat-icon {
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
}

.stat-success .stat-icon {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--success-color);
}

.stat-info .stat-icon {
    background-color: rgba(54, 185, 204, 0.1);
    color: var(--info-color);
}

.stat-warning .stat-icon {
    background-color: rgba(246, 194, 62, 0.1);
    color: var(--warning-color);
}

.stat-danger .stat-icon {
    background-color: rgba(231, 74, 59, 0.1);
    color: var(--danger-color);
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #b7b9cc;
    margin: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.stat-info {
    font-size: 0.8rem;
    margin: 0;
    color: #858796;
}

.stat-info i {
    margin-right: 5px;
}

/* Notificaciones */
.notification-center {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
    transition: all 0.2s ease;
}

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

.notification-item:hover {
    background-color: #f8f9fc;
}

.notification-item.unread {
    background-color: rgba(78, 115, 223, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.notification-text {
    font-size: 0.85rem;
    color: #858796;
    margin-bottom: 0.3rem;
}

.notification-time {
    font-size: 0.75rem;
    color: #b7b9cc;
}

/* Empresa Cards */
.empresa-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.empresa-card {
    background-color: white;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    overflow: hidden;
    transition: all 0.2s ease;
}

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

.empresa-header {
    position: relative;
    padding: 1.5rem;
    text-align: center;
    background-color: var(--primary-color);
    color: white;
}

.empresa-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background-color: white;
    padding: 5px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empresa-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.empresa-nombre {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empresa-categoria {
    font-size: 0.8rem;
    opacity: 0.8;
}

.empresa-body {
    padding: 1.5rem;
}

.empresa-descripcion {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6e707e;
    height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.empresa-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.empresa-stat {
    text-align: center;
}

.empresa-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.empresa-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #b7b9cc;
}

.empresa-actions {
    display: flex;
    gap: 0.5rem;
}

.empresa-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

/* Login y Registro */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, #4e73df, #224abe);
}

.auth-card {
    max-width: 450px;
    width: 100%;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.auth-header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-logo {
    margin-bottom: 1rem;
}

.auth-logo img {
    height: 60px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.auth-body {
    padding: 2rem;
}

.auth-footer {
    padding: 1rem 2rem;
    background-color: #f8f9fc;
    border-top: 1px solid #e3e6f0;
    text-align: center;