* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-large {
    padding: 20px 40px;
    font-size: 20px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.home-page .hero {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.home-page .hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.home-page .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.get-code-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.stock-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    margin-bottom: 30px;
}

.hint {
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.captcha-box {
    margin-bottom: 25px;
}

.captcha-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.captcha-input {
    width: 120px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: border-color 0.3s;
}

.captcha-input:focus {
    outline: none;
    border-color: #667eea;
}

.captcha-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    font-size: 14px;
}

.captcha-img {
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s;
}

.captcha-img:hover {
    border-color: #667eea;
}

.empty-state, .already-received {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.empty-icon, .received-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    margin-bottom: 20px;
}

#modalIcon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.modal-body {
    margin-bottom: 20px;
}

.code-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#resultCode {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    word-break: break-all;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
}

.admin-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
}

.admin-link:hover {
    color: white;
}

.admin-page .container {
    padding-top: 40px;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    margin: 100px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #333;
}

.dashboard {
    margin-bottom: 30px;
}

.stock-alert {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stock-alert h3 {
    margin-bottom: 15px;
    color: #333;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.stock-percent {
    font-size: 2.5rem;
    font-weight: bold;
}

.stock-message {
    font-size: 1.1rem;
    color: #666;
}

.progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-card.success .stat-value {
    color: #28a745;
}

.stat-card.warning .stat-value {
    color: #ffc107;
}

.stat-card.info .stat-value {
    color: #17a2b8;
}

.upload-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.upload-section h2 {
    margin-bottom: 10px;
    color: #333;
}

.upload-hint {
    color: #666;
    margin-bottom: 20px;
}

.file-input-wrapper {
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 12px 24px;
    background: #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.file-label:hover {
    background: #dee2e6;
}

.file-name {
    margin-left: 15px;
    color: #666;
}

.upload-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.upload-result.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.upload-result.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

.quick-links {
    text-align: center;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.db-status-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.db-status-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.table-status-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.table-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 8px;
    background: #f8f9fa;
}

.table-status-item.status-ok {
    background: #d4edda;
}

.table-status-item.status-error {
    background: #f8d7da;
}

.table-name {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.table-badge {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .home-page .hero h1 {
        font-size: 1.8rem;
    }
    
    .get-code-section {
        padding: 30px 20px;
    }
    
    .btn-large {
        padding: 15px 30px;
        font-size: 18px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
