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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box h2 {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    font-weight: normal;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.forgot-link {
    text-align: center;
    margin-top: 20px;
}

.forgot-link a {
    color: #007bff;
    text-decoration: none;
}

.dashboard {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header h1 {
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    color: #666;
}

.dashboard h2 {
    color: #333;
    margin-bottom: 20px;
}

.licenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    gap: 20px;
}

.license-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
    min-width: 0;
    overflow: hidden;
}

.license-card.status-active {
    border-left: 4px solid #28a745;
}

.license-card.status-unused {
    border-left: 4px solid #6c757d;
}

.license-card.status-revoked {
    border-left: 4px solid #dc3545;
}

.license-key {
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.license-status {
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

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

.status-badge.unused {
    background-color: #e2e3e5;
    color: #383d41;
}

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

.license-details {
    margin-bottom: 15px;
}

.license-details p {
    color: #666;
    margin-bottom: 5px;
}

.not-activated {
    color: #6c757d;
    font-style: italic;
}

.revoked-notice {
    color: #dc3545;
    font-weight: 500;
}

.deactivate-form {
    margin-top: 10px;
}

.license-header {
    margin-bottom: 15px;
}

.history-toggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-expand {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 0;
    text-decoration: underline;
}

.btn-expand:hover {
    color: #0056b3;
}

.history-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.history-section h4 {
    color: #333;
    margin-bottom: 12px;
    font-size: 14px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
    min-width: 100%;
}

.history-table th {
    background-color: #f0f0f0;
    color: #333;
    padding: 8px 6px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    font-size: 12px;
}

.history-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    color: #666;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.history-table tr:hover {
    background-color: #fafafa;
}

.history-table code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 10px;
    word-break: break-all;
}

.history-table th:first-child,
.history-table td:first-child {
    width: 28%;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 22%;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    width: 18%;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    width: 32%;
}

.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.action-activated {
    background-color: #d4edda;
    color: #155724;
}

.action-deactivated {
    background-color: #fff3cd;
    color: #856404;
}

.action-verified {
    background-color: #cfe2ff;
    color: #084298;
}

.no-licenses {
    text-align: center;
    padding: 40px;
    color: #666;
}

@media (max-width: 800px) {
    .licenses-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        padding: 10px;
    }
    
    .dashboard {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .licenses-grid {
        display: block !important;
    }
    
    .license-card {
        padding: 15px;
        margin-bottom: 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .license-key {
        font-size: 14px;
        word-break: break-all;
    }
    
    .license-details p {
        font-size: 13px;
    }
    
    .history-section {
        margin-top: 10px;
        padding-top: 10px;
        overflow: visible;
    }
    
    .history-section h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    /* Stacked card layout for mobile */
    .history-table,
    .history-table tbody {
        display: block;
        width: 100%;
    }
    
    .history-table tr:first-child {
        display: none;
    }
    
    .history-table tr {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        margin-bottom: 10px;
        padding: 12px;
        width: 100%;
    }
    
    .history-table tr:hover {
        background: #fff;
    }
    
    .history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid #f0f0f0;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .history-table td:last-child {
        border-bottom: none;
    }
    
    .history-table td::before {
        font-weight: 600;
        color: #333;
        font-size: 12px;
        flex-shrink: 0;
        margin-right: 10px;
    }
    
    .history-table td:first-child::before {
        content: "Date:";
    }
    
    .history-table td:nth-child(2)::before {
        content: "Action:";
    }
    
    .history-table td:nth-child(3)::before {
        content: "Computer:";
    }
    
    .history-table td:nth-child(4)::before {
        content: "IP:";
    }
    
    .history-table code {
        font-size: 11px;
        word-break: break-all;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .btn-expand {
        font-size: 13px;
    }
    
    .login-box {
        margin: 20px;
        padding: 20px;
    }
}
