* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.login-tab.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
    margin-bottom: -2px;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    font-weight: 600;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button.secondary {
    background: #6c757d;
}

button.success {
    background: #28a745;
}

button.danger {
    background: #dc3545;
}

button.warning {
    background: #ffc107;
    color: #333;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Main App */
.main-container {
    display: none;
}

.main-container.visible {
    display: block;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 2em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-type-badge {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-tabs {
    background: white;
    padding: 0 30px;
    border-bottom: 1px solid #e0e0e0;
}

.nav-tab {
    display: inline-block;
    padding: 15px 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    margin-right: 10px;
}

.nav-tab:hover {
    color: #667eea;
}

.nav-tab.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.content {
    padding: 30px;
    background: white;
    border-radius: 0 0 10px 10px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .label {
    font-size: 12px;
    opacity: 0.8;
}

/* Generator Section */
.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.license-preview {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 18px;
    text-align: center;
    margin: 15px 0;
    border: 2px dashed #667eea;
    word-break: break-all;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th {
    background: #f1f1f1;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.data-table td {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.data-table tr:hover {
    background: #f5f5f5;
}

.status-active {
    color: #28a745;
    font-weight: 600;
}

.status-expired {
    color: #dc3545;
    font-weight: 600;
}

.status-revoked {
    color: #6c757d;
    font-weight: 600;
}

.status-suspended {
    color: #ffc107;
    font-weight: 600;
}

.search-box {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: white;
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Feature Panel Styling */
.feature-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin: 25px 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-panel h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card.enabled {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.feature-card.enabled::before {
    background: white;
    opacity: 0.3;
}

.feature-card.enabled .feature-name,
.feature-card.enabled .feature-desc {
    color: white;
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: #667eea;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card.enabled .feature-icon {
    color: white;
}

.feature-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: #333;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.feature-desc {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.feature-checkbox {
    margin-top: 12px;
}

.feature-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 4px;
}

.feature-checkbox input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.license-summary {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e9ff 100%);
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.summary-item .value {
    color: #667eea;
    font-weight: 700;
    font-size: 14px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.time-badge {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
    display: inline-block;
}

.user-badge {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.user-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-reseller {
    background: #28a745;
    color: white;
}

.action-badge {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.action-success { background: #d4edda; color: #155724; }
.action-primary { background: #cce5ff; color: #004085; }
.action-warning { background: #fff3cd; color: #856404; }
.action-secondary { background: #e2e3e5; color: #383d41; }
.action-info { background: #d1ecf1; color: #0c5460; }

.btn-small {
    padding: 3px 8px;
    font-size: 11px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
    font-size: 14px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}