:root {
    --primary-color: #1c244b;
    --bg-color: #f3f5f8;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    width: 100%;
    overflow: hidden;
}

.header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.content {
    padding: 30px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(28, 36, 75, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 36, 75, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.license-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.license-info h3 {
    margin-bottom: 16px;
    color: #333;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #333;
}

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

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-section {
    max-width: 400px;
    margin: 0 auto;
}

.auth-alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.5;
}

.auth-alert.show {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 1;
    transform: translateY(0);
}

.auth-alert::before {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.auth-alert.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b1dfbb;
    box-shadow: 0 4px 12px rgba(21, 87, 36, 0.15);
}

.auth-alert.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23155724'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
}

.auth-alert.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
    box-shadow: 0 4px 12px rgba(114, 28, 36, 0.15);
}

.auth-alert.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23721c24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

.auth-alert.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #abdde5;
    box-shadow: 0 4px 12px rgba(12, 84, 96, 0.15);
}

.auth-alert.info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230c5460'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

.hidden {
    display: none !important;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

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

.stat-card.stat-active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #b1dfbb;
}

.stat-card.stat-inactive {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #f1b0b7;
}

.stat-card.stat-expired {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border-color: #ffd966;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: flex-end;
}

.filter-bar select {
    max-width: 200px;
}

.btn-small {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 44px;
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 36, 75, 0.3);
}

/* Licenses Table */
.licenses-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    background: white;
}

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

.licenses-table thead {
    background: var(--primary-color);
    color: white;
}

.licenses-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.licenses-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

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

.licenses-table tbody tr:last-child td {
    border-bottom: none;
}

.license-key {
    background: #f1f3f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary-color);
}

.loading-row,
.empty-row,
.error-row {
    text-align: center;
    padding: 40px 20px !important;
    color: #666;
    font-style: italic;
}

.error-row {
    color: #721c24;
}

/* Button Icons */
.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.btn-icon svg {
    display: block;
}

.btn-icon:hover {
    background: #f0f0f0;
    transform: scale(1.1);
    color: var(--primary-color);
}

.btn-icon.btn-danger:hover {
    background: #f8d7da;
    color: #721c24;
}

/* Valid/Invalid Badges */
.valid-badge,
.invalid-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

.valid-badge {
    background: #d4edda;
    color: #155724;
}

.valid-badge svg {
    stroke: #155724;
}

.invalid-badge {
    background: #f8d7da;
    color: #721c24;
}

.invalid-badge svg {
    stroke: #721c24;
}

/* Status badges for different states */
.status-badge.status-suspended {
    background: #fff3cd;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }

    .content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .logo {
        width: 80px;
    }

    .content {
        padding: 16px;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tab {
        flex: 1 1 calc(33.333% - 8px);
        font-size: 13px;
        padding: 10px 8px;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 11px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar select {
        max-width: 100%;
    }

    .btn-small {
        width: 100%;
    }

    .licenses-table {
        font-size: 12px;
    }

    .licenses-table th,
    .licenses-table td {
        padding: 10px 8px;
    }

    .licenses-table th:nth-child(2),
    .licenses-table td:nth-child(2),
    .licenses-table th:nth-child(5),
    .licenses-table td:nth-child(5) {
        display: none;
    }

    .btn-icon {
        padding: 6px;
    }

    .license-info {
        padding: 16px;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .tab {
        flex: 1 1 100%;
        font-size: 14px;
    }

    .licenses-table th:nth-child(3),
    .licenses-table td:nth-child(3) {
        display: none;
    }

    .license-key {
        font-size: 10px;
        padding: 3px 6px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }
}