/* Admin Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #2c2c2c;
    line-height: 1.6;
}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.auth-mascot {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.auth-header h2 {
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-size: 1.8rem;
}

.auth-header p {
    color: #666;
    margin-bottom: 2rem;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.auth-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #2c2c2c;
}

.auth-button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: #2c2c2c;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background: #1a1a1a;
}

.auth-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dashboard Layout */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-mascot {
    width: 50px;
    height: 50px;
}

.header-brand h1 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.header-brand p {
    color: #666;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-button:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.logout-button {
    padding: 0.75rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.logout-button:hover {
    background: #dc2626;
}

/* Dashboard Main */
.dashboard-main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Statistics Section */
.stats-section {
    margin-bottom: 3rem;
}

/* Actions Section */
.actions-section {
    margin-bottom: 3rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-buttons button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Lookup Section */
.lookup-section {
    margin-bottom: 3rem;
}

.lookup-form .form-group {
    display: flex;
    gap: 1rem;
    max-width: 500px;
}

.lookup-input {
    flex: 1;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.lookup-input:focus {
    outline: none;
    border-color: #2c2c2c;
}

.lookup-btn {
    padding: 0.875rem 1.5rem;
    white-space: nowrap;
}

/* Customer Results */
.customer-results {
    margin-top: 2rem;
}

.customer-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1rem;
}

.customer-header h4 {
    color: #1a1a1a;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.customer-email {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.customer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.licenses-section h5 {
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.licenses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.license-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.license-key {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    color: #2c2c2c;
    flex: 1;
    min-width: 200px;
}

.license-details {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.license-tier {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.tier-basic {
    background: #dbeafe;
    color: #1d4ed8;
}

.tier-plus {
    background: #fef3c7;
    color: #92400e;
}

.license-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.license-date {
    font-size: 0.8rem;
    color: #666;
}

.customer-not-found, .no-licenses {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.customer-not-found h4 {
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.customer-not-found p, .no-licenses p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Legacy Section */
.legacy-section {
    margin-bottom: 3rem;
}

.legacy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.legacy-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.legacy-card h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legacy-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.legacy-card small {
    color: #888;
    font-size: 0.8rem;
}

/* Primary action button in header */
.action-button.primary {
    background: #2c2c2c;
    color: white;
}

.action-button.primary:hover {
    background: #1a1a1a;
}

/* Section headers */
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: #1a1a1a;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 0.95rem;
}

/* Generate form styles */
.generate-form .form-group {
    margin-bottom: 1.5rem;
}

.generate-form label {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.generate-form input,
.generate-form select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.generate-form input:focus,
.generate-form select:focus {
    outline: none;
    border-color: #2c2c2c;
}

.generate-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.license-icon { background: linear-gradient(135deg, #667eea, #764ba2); }
.basic-icon { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.plus-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.revenue-icon { background: linear-gradient(135deg, #34d399, #10b981); }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    margin-bottom: 2rem;
}

.table-header {
    padding: 2rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header h2 {
    color: #1a1a1a;
    font-size: 1.3rem;
}

.table-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input, .filter-select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: #2c2c2c;
}

.search-input {
    width: 200px;
}

.table-container {
    overflow-x: auto;
}

.registrations-table {
    width: 100%;
    border-collapse: collapse;
}

.registrations-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #e0e0e0;
}

.registrations-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #4a4a4a;
}

.registrations-table tbody tr:hover {
    background: #f8f9fa;
}

.loading-row {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

.premium-badge {
    background: #22c55e;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.table-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Section */
.status-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.status-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.status-card h3 {
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b7280;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-main {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .auth-content {
        padding: 2rem;
        margin: 1rem;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Success/Error States */
.success-message {
    background: #dcfce7;
    color: #166534;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    margin: 1rem 0;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin: 1rem 0;
}