* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000000;
    color: #e0e0e0;
    line-height: 1.5;
    font-size: 14px;
}

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #000000;
}

.login-box {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.login-box h1 {
    color: #6366f1;
    margin-bottom: 8px;
    font-size: 28px;
    text-align: center;
    font-weight: 600;
}

.subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.error-message {
    background: #dc2626;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #991b1b;
}

/* Form Elements */
.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-label {
    display: block;
    margin-bottom: 6px;
    color: #a0a0a0;
    font-size: 14px;
    font-weight: 500;
}

.login-form .form-input {
    width: 100%;
    padding: 12px 14px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.login-form .form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form .btn-primary {
    width: 100%;
    padding: 12px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-form .btn-primary:hover {
    background: #5558e3;
    transform: translateY(-1px);
}

.login-info {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 12px;
    background: #0f0f0f;
    border-radius: 6px;
    border: 1px solid #1a1a1a;
}

.login-info a {
    color: #6366f1;
    text-decoration: none;
}

.login-info a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0a0a0a;
    border-right: 1px solid #1a1a1a;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #1a1a1a;
}

.sidebar-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h2 i {
    color: #6366f1;
}

.sidebar-header p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: #0f0f0f;
    color: #ccc;
}

.sidebar-nav a.active {
    background: #0f0f0f;
    color: #6366f1;
    border-left-color: #6366f1;
}

.sidebar-nav i {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #1a1a1a;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px 40px;
    min-height: 100vh;
    background: #000000;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.content-header p {
    color: #666;
    font-size: 15px;
}

/* Client Portal Header */
.client-portal-header {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid #1a1a1a;
}

.client-portal-header h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.client-portal-header p {
    color: #888;
    font-size: 16px;
}

/* Cards */
.card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #1a1a1a;
    color: #ccc;
}

.btn-secondary:hover {
    background: #2a2a2a;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #2a2a2a;
    transform: translateY(-2px);
}

.stat-card-label {
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card-label i {
    color: #6366f1;
}

.stat-card-value {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.app-card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.app-card:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.app-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.app-card-subtitle {
    font-size: 12px;
    color: #666;
}

.app-card-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #1a1a1a;
    font-size: 12px;
    color: #666;
}

.app-card-meta div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Download Cards */
.download-card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.download-card:hover {
    border-color: #2a2a2a;
}

.download-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.download-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.download-card-version {
    font-size: 12px;
    color: #666;
    margin-left: 8px;
}

.download-card-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #1a1a1a;
    font-size: 12px;
    color: #666;
}

.download-card-meta div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Tabs */
.tab-container {
    display: flex;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 32px;
    gap: 4px;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab:hover {
    color: #888;
}

.tab.active {
    color: #6366f1;
}

.tab.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #6366f1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Redeem Box */
.redeem-box {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
}

.redeem-box h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.redeem-input-container {
    margin-bottom: 24px;
}

.redeem-input-container label {
    display: block;
    margin-bottom: 8px;
    color: #a0a0a0;
    font-size: 14px;
    font-weight: 500;
}

.redeem-input {
    width: 100%;
    padding: 14px 16px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    transition: all 0.2s;
}

.redeem-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.redeem-help {
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.redeem-help h4 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.redeem-help ul {
    list-style: none;
    padding-left: 0;
}

.redeem-help li {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.redeem-help li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #6366f1;
    font-size: 16px;
}

/* Search Input */
.search-input {
    padding: 10px 14px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
}

.search-input::placeholder {
    color: #555;
}

/* Code */
code {
    font-family: 'Monaco', 'Consolas', monospace;
    background: #0f0f0f;
    padding: 4px 8px;
    border-radius: 4px;
    color: #6366f1;
    font-size: 12px;
    border: 1px solid #1a1a1a;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.3;
    color: #6366f1;
}

/* Utility Classes */
.mb-6 { margin-bottom: 24px; }
.p-6 { padding: 24px; }
.w-full { width: 100%; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a2a2a;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #555;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.2s ease-out;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #1a1a1a;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Added for Data Table */
.table-container {
    overflow-x: auto;
    border-radius: 0 0 12px 12px;
}

.data-table {
    width: 100%;
    background: #0a0a0a;
    border-collapse: collapse;
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    background: #0f0f0f;
    color: #6366f1;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #1a1a1a;
    white-space: nowrap;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #1a1a1a;
    color: #ccc;
    font-size: 13px;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #0f0f0f;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Status Indicator */
.status-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-active { background: #10b981; }
.status-expired { background: #ef4444; }
.status-banned { background: #dc2626; }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #1a1a1a;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Modern Select */
.select-wrapper {
    position: relative;
}

.modern-select {
    width: 100%;
    padding: 12px 14px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.modern-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Apps Select Container */
.apps-select-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    padding: 12px;
    background: #0f0f0f;
}

.app-checkbox-item {
    margin-bottom: 8px;
}

.app-checkbox {
    display: none;
}

.app-checkbox-label {
    display: block;
    padding: 12px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.app-checkbox:checked + .app-checkbox-label {
    background: #0f0f0f;
    border-color: #6366f1;
    color: #6366f1;
}

.app-checkbox-label:hover {
    background: #0f0f0f;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 100;
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    max-width: 300px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Form Group */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #a0a0a0;
    font-size: 14px;
    font-weight: 500;
}

.form-help {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

/* Form Row */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* Key Format */
.key-format {
    font-family: 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.5px;
    color: #6366f1;
    background: #0f0f0f;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #1a1a1a;
    font-size: 12px;
}

/* Reseller Stats */
.reseller-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0 30px;
}

.reseller-stat {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 20px;
}

.reseller-stat-label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.reseller-stat-value {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

.reseller-stat-sub {
    color: #666;
    font-size: 11px;
    margin-top: 4px;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}