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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    color: #4a5568;
}

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

header {
    text-align: center;
    color: #4a5568;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    font-weight: 300;
    color: #2d3748;
}

.subtitle {
    font-size: 1em;
    color: #718096;
    font-weight: 300;
}

.generator-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group input[type="file"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #f7fafc;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #cbd5e0;
    background: white;
    box-shadow: 0 0 0 3px rgba(237, 242, 247, 0.5);
}

.section-divider {
    margin: 30px 0 20px 0;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.section-divider h3 {
    color: #4a5568;
    font-size: 1em;
    margin-bottom: 15px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #a0aec0;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #a0aec0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-primary {
    background: #a0aec0;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #90a4ae;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(160, 174, 192, 0.3);
}

.btn-secondary {
    background: #cbd5e0;
    color: #4a5568;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #a0aec0;
    color: white;
}

.preview-container {
    margin-top: 30px;
    padding: 24px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e0;
    text-align: center;
}

.preview-container h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 500;
}

.preview-loading {
    color: #a0aec0;
    font-style: italic;
    padding: 40px;
}

.preview-note {
    display: block;
    margin-top: 10px;
    color: #a0aec0;
    font-size: 0.85em;
}

#previewImageContainer img {
    max-width: 800px;
    width: auto;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#qrImageContainer img {
    max-width: 800px;
    width: auto;
    height: auto;
}

.result-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.result-container h3 {
    margin-bottom: 20px;
    color: #4a5568;
    font-weight: 500;
}

#qrImageContainer {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.qr-details {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.qr-details p {
    margin: 6px 0;
    color: #4a5568;
    font-size: 14px;
}

.color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    margin-right: 4px;
}

.result-actions {
    margin-top: 15px;
}

.tracking-info {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.tracking-info p {
    margin: 8px 0;
    color: #4a5568;
    font-size: 14px;
}

.tracking-info a {
    color: #718096;
    text-decoration: none;
    word-break: break-all;
}

.tracking-info a:hover {
    color: #4a5568;
    text-decoration: underline;
}

footer {
    text-align: center;
    color: #a0aec0;
    margin-top: 40px;
    font-size: 14px;
}

footer a {
    color: #718096;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    color: #4a5568;
    text-decoration: underline;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

.login-container h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 30px;
    font-weight: 300;
}

.error-message {
    color: #e53e3e;
    margin-top: 15px;
    padding: 10px;
    background: #fed7d7;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* Admin Dashboard */
.stats-summary {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

.table-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.data-table th {
    background: #f7fafc;
    font-weight: 500;
    color: #4a5568;
}

.data-table tr:hover {
    background: #f7fafc;
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table a {
    color: #718096;
    text-decoration: none;
    margin-right: 10px;
}

.data-table a:hover {
    color: #4a5568;
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.3);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.close {
    color: #a0aec0;
    float: right;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #4a5568;
}

.modal-content h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-weight: 400;
}

.modal-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #4a5568;
    font-weight: 500;
    font-size: 16px;
}

.modal-content ul {
    list-style-position: inside;
    margin-bottom: 20px;
}

.modal-content li {
    margin: 5px 0;
    color: #718096;
    font-size: 14px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-card h2 {
    color: #2d3748;
    font-size: 1.6em;
    font-weight: 400;
    margin-bottom: 4px;
    word-break: break-word;
}

.stat-card p {
    color: #a0aec0;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chart-card h3 {
    color: #4a5568;
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-empty {
    color: #a0aec0;
    text-align: center;
    padding: 40px 0;
    font-style: italic;
}

.stats-qr-image {
    text-align: center;
    margin-bottom: 24px;
}

.stats-qr-image img {
    max-width: 200px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .generator-card {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .table-container {
        overflow-x: scroll;
    }
}
