/* Admin Styles */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
}

/* Layout */
.admin-wrapper {
    min-height: 100vh;
}

.admin-header {
    background: #1a1a1a;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.25rem;
}

.admin-header nav {
    display: flex;
    gap: 0.5rem;
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 13px;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:not(.btn-primary):not(.btn-danger) {
    background: #e5e5e5;
    color: #333;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
}

.login-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 380px;
}

.login-container h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.login-container h2 {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    color: #666;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group input[type="file"] {
    font-size: 14px;
}

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

.form-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: #666;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

.current-image {
    margin-bottom: 0.5rem;
}

.current-image .preview {
    max-width: 200px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.current-image label {
    font-weight: 400;
    font-size: 13px;
    color: #666;
}

/* QR Section */
.qr-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.qr-large {
    width: 150px;
    height: 150px;
}

.qr-info p {
    margin: 0 0 0.5rem;
}

.qr-info .hint {
    font-size: 12px;
    color: #888;
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
}

.data-table th {
    background: #f9f9f9;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    border-bottom: 2px solid #eee;
}

.data-table td {
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

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

.data-table .thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.data-table .no-image {
    color: #ccc;
}

.data-table code {
    background: #f5f5f5;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 13px;
}

.cell-image {
    width: 70px;
}

.cell-qr {
    width: 100px;
}

.cell-qr .qr-thumb {
    width: 60px;
    height: 60px;
}

.cell-qr .qr-actions {
    margin-top: 0.25rem;
}

.cell-actions {
    white-space: nowrap;
}

.cell-actions .btn {
    margin-right: 0.25rem;
}

.link-small {
    font-size: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-state p {
    color: #666;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-main {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .qr-section {
        flex-direction: column;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}
