:root {
    --primary-color: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary-color: #7209b7;
    --accent-color: #4cc9f0;
    --success-color: #38b000;
    --danger-color: #ef233c;
    --warning-color: #ff9e00;
    --dark-color: #14213d;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7ff;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1a2e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    padding: 30px 0;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: var(--transition);
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0 20px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 30px;
}

.sidebar li a i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar li.active a {
    background-color: var(--primary-color);
    color: white;
    border-left: 4px solid var(--accent-color);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 30px;
    min-height: 100vh;
    transition: var(--transition);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--gray-color);
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(67, 97, 238, 0.4);
    color: white;
}

.btn i {
    margin-right: 8px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-danger {
    background: linear-gradient(to right, var(--danger-color), #d90429);
}

.btn-success {
    background: linear-gradient(to right, var(--success-color), #2b9348);
}

.btn-warning {
    background: linear-gradient(to right, var(--warning-color), #f3722c);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    outline: none;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    user-select: none;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(67, 97, 238, 0.05);
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fff5f5;
    border-color: var(--danger-color);
    color: #dc3545;
}

.alert-success {
    background-color: #f0fff4;
    border-color: var(--success-color);
    color: #28a745;
}

.alert-warning {
    background-color: #fffaf0;
    border-color: var(--warning-color);
    color: #fd7e14;
}

.alert-info {
    background-color: #f0f8ff;
    border-color: var(--accent-color);
    color: #17a2b8;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(56, 176, 0, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background-color: rgba(239, 35, 60, 0.1);
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        left: -280px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
}

/* Admin specific styles */
.admin-stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.admin-stat-card h3 {
    font-size: 1rem;
    color: var(--gray-color);
    margin-bottom: 10px;
}

.admin-stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination .btn-small {
    min-width: 40px;
    text-align: center;
}

.pagination .active {
    background: var(--primary-dark);
    color: white;
}

@media print {
    .sidebar, .btn {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
}

/* Admin specific styles */
.welcome {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--gray-color);
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* License Management Styles */
.search-box {
    margin-left: auto;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-modal {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

.license-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-expired {
    background-color: #fff3cd;
    color: #856404;
}

@media (max-width: 768px) {
    .search-box {
        margin-top: 10px;
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
}