:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --dark-color: #1d3557;
    --light-color: #f8f9fa;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--dark-color), var(--secondary-color));
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    box-shadow: 3px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
    transition: opacity 0.3s;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-nav {
    padding: 20px 0;
    overflow-y: auto;
    height: calc(100vh - 110px);
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    margin: 5px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-left: 4px solid var(--success-color);
}

.sidebar-nav .nav-link i {
    margin-right: 15px;
    font-size: 18px;
    width: 25px;
    text-align: center;
}

.sidebar-nav .nav-link span {
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav .nav-link.collapsed::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    transition: transform 0.3s;
}

.sidebar-nav .nav-link:not(.collapsed)::after {
    content: '\f077';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    transform: rotate(180deg);
    transition: transform 0.3s;
}

.sub-nav {
    padding-left: 40px !important;
    margin-top: 5px !important;
}

.sub-nav li a {
    color: rgba(255,255,255,0.6) !important;
    padding: 8px 15px !important;
    font-size: 14px;
    transition: all 0.3s;
}

.sub-nav li a:hover {
    color: white !important;
    background: rgba(255,255,255,0.05) !important;
    padding-left: 20px !important;
}

.sub-nav li a.active {
    color: var(--success-color) !important;
}

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.main.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.header {
    background: white;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left h1 {
    font-size: 24px;
    color: var(--dark-color);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info span {
    font-weight: 500;
    color: var(--dark-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.content {
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

/* Login Page */
.login-bg {
    background: linear-gradient(135deg, var(--dark-color), var(--secondary-color));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header h2 {
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    font-size: 14px;
}

.input-group {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.input-group:focus-within {
    border-color: var(--primary-color);
}

.input-group-text {
    background: #f5f7fb;
    border: none;
    color: var(--primary-color);
}

.form-control {
    border: none;
    border-radius: 0;
    padding: 12px 15px;
}

.form-control:focus {
    box-shadow: none;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 15px;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

/* Dashboard Cards */
.card-dashboard {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
}

.card-dashboard:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 24px;
}

.card-icon.primary {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.card-icon.success {
    background: rgba(76, 201, 240, 0.1);
    color: var(--success-color);
}

.card-icon.warning {
    background: rgba(248, 150, 30, 0.1);
    color: var(--warning-color);
}

.card-icon.danger {
    background: rgba(247, 37, 133, 0.1);
    color: var(--danger-color);
}

.card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #999;
}

/* Modern Table */
.table-modern {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table-modern thead {
    background: var(--primary-color);
    color: white;
}

.table-modern thead th {
    font-weight: 600;
    padding: 15px;
    border: none;
}

.table-modern tbody tr {
    transition: background 0.3s;
}

.table-modern tbody tr:hover {
    background: #f5f7fb;
}

.table-modern tbody td {
    padding: 12px 15px;
    border-color: #eee;
}

/* Action Buttons */
.btn-action {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin: 2px;
    transition: all 0.3s;
}

.btn-action i {
    margin-right: 5px;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
    border: none;
}

.btn-edit:hover {
    background: #e67e22;
    transform: scale(1.05);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    border: none;
}

.btn-delete:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.btn-view {
    background: var(--info-color);
    color: white;
    border: none;
}

.btn-view:hover {
    background: #1976d2;
    transform: scale(1.05);
}

/* Form Moderno */
.form-modern .form-group {
    margin-bottom: 20px;
}

.form-modern label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: block;
}

.form-modern .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s;
}

.form-modern .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-modern .btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.form-modern .btn-submit:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}