* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: #fff;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    opacity: 0.5;
    z-index: -1;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    max-width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #4fd1c7 0%, #a8edea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 48px;
    line-height: 1;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #4fd1c7;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.content-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.license-list, .instance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.license-item, .instance-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.license-item:hover, .instance-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(79, 209, 199, 0.3);
}

.license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.license-key {
    font-size: 18px;
    font-weight: 600;
    color: #4fd1c7;
    letter-spacing: 1px;
}

.license-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.icon-btn.delete:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.license-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.detail-value {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge.trial {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.badge.professional {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.badge.enterprise {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
}

.badge.euser-hub {
    background: rgba(79, 209, 199, 0.2);
    color: #4fd1c7;
}

.badge.emedia-hub {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.empty {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}


.new-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.new-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.new-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.new-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.new-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.new-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.new-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.new-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.new-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.new-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.new-modal-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.new-modal-message.success {
    display: block;
    background: rgba(79, 209, 199, 0.15);
    border: 1px solid rgba(79, 209, 199, 0.3);
    color: #4fd1c7;
}

.new-modal-message.error {
    display: block;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.new-form-group {
    margin-bottom: 20px;
}

.new-form-group:last-child {
    margin-bottom: 0;
}

.new-form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
}

.new-form-group input,
.new-form-group textarea,
.new-form-group select,
.new-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.new-form-group input:focus,
.new-form-group textarea:focus,
.new-form-group select:focus,
.new-input:focus {
    outline: none;
    border-color: rgba(79, 209, 199, 0.5);
    background: rgba(0, 0, 0, 0.4);
}

.toggle-tabs {
    display: flex;
    width: 100%;
    height: 46px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.toggle-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.toggle-tab.active {
    background: rgba(79, 209, 199, 0.2);
    color: #4fd1c7;
}

.info-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.info-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}

.info-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-value {
    color: #4fd1c7;
    font-size: 16px;
    font-weight: 500;
}

.new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-btn-primary {
    background: rgba(79, 209, 199, 0.2);
    color: #4fd1c7;
    border: 1px solid rgba(79, 209, 199, 0.3);
}

.new-btn-primary:hover {
    background: rgba(79, 209, 199, 0.3);
}

.new-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.new-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.new-btn-danger {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.new-btn-danger:hover {
    background: rgba(255, 107, 107, 0.3);
}

@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .license-details {
        grid-template-columns: 1fr;
    }
}

.global-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transform: translateX(400px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.global-toast.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.global-toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
}

.global-toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
}

.global-toast.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
}

.global-toast.warning {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.95), rgba(249, 115, 22, 0.95));
}

@keyframes slideUpFade {
    to {
        opacity: 0;
        transform: translateY(-30px) translateX(0);
    }
}

.global-toast.slide-up {
    animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
