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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.03) 2px,
            rgba(255,255,255,0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.03) 2px,
            rgba(255,255,255,0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

body > * {
    position: relative;
    z-index: 2;
}

.container {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 2px solid #555;
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 8px 25px rgba(0,0,0,0.4),
        0 0 0 1px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    pointer-events: none;
}

.admin-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 2px solid #555;
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 8px 25px rgba(0,0,0,0.4),
        0 0 0 1px rgba(0,0,0,0.3);
    min-height: calc(100vh - 40px);
    overflow: hidden;
}

h1 {
    color: #f0f0f0;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-weight: 300;
    letter-spacing: 1px;
}

h2 {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: 300;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #b0b0b0;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 14px;
    color: #f0f0f0;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 0 0 2px rgba(0,122,204,0.3);
    background: #333;
}

.btn {
    background: linear-gradient(145deg, #4a5568, #2d3748);
    color: #f0f0f0;
    border: 1px solid #718096;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 8px 4px;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn:hover {
    background: linear-gradient(145deg, #5a6578, #3d4758);
    transform: translateY(-1px);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-danger {
    background: linear-gradient(145deg, #e53e3e, #c53030);
    border-color: #fc8181;
}

.btn-danger:hover {
    background: linear-gradient(145deg, #f56565, #e53e3e);
}

.btn-success {
    background: linear-gradient(145deg, #38a169, #2f855a);
    border-color: #68d391;
}

.btn-success:hover {
    background: linear-gradient(145deg, #48bb78, #38a169);
}

.btn:disabled {
    background: linear-gradient(145deg, #4a5568, #2d3748);
    color: #718096;
    border-color: #4a5568;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.camera-section {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#video {
    width: 100%;
    max-width: 320px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#canvas {
    display: none;
}

.captured-image {
    max-width: 320px;
    width: 100%;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#capturedImageContainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    margin: 20px 0;
}

.upload-area.dragover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-area input[type="file"] {
    display: none;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

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

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

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border-bottom: 2px solid #555;
    margin: 0;
}

.admin-nav h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.tabs {
    display: flex;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border-bottom: 2px solid #555;
    margin: 0;
}

.tab {
    background: transparent;
    border: none;
    padding: 18px 35px;
    cursor: pointer;
    font-size: 15px;
    color: #b0b0b0;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab:hover {
    background: rgba(255,255,255,0.05);
    color: #d0d0d0;
}

.tab.active {
    color: #ffffff;
    border-bottom-color: #007acc;
    background: rgba(0,122,204,0.1);
}

.tab-content {
    display: none;
    padding: 35px;
}

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

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.user-card {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: 1px solid #666;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
}

.user-card h3 {
    color: #ffffff;
    margin-bottom: 15px;
}

.user-card p {
    color: #d0d0d0;
    margin-bottom: 8px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.image-card {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: 1px solid #666;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
}

.image-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #555;
}

.image-info {
    font-size: 12px;
    color: #c0c0c0;
    margin-bottom: 15px;
    line-height: 1.4;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 2px solid #555;
    margin: 10% auto;
    padding: 35px;
    border-radius: 8px;
    width: 90%;
    max-width: 550px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 12px 40px rgba(0,0,0,0.5);
}

.close {
    color: #bbb;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #fff;
}

.images-header {
    margin-bottom: 25px;
}

.filter-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: end;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: 1px solid #666;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    color: #b0b0b0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 1px solid #555;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #d0d0d0;
    font-size: 14px;
}

.stats-bar span {
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #b0b0b0;
    font-size: 14px;
}

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

    .container {
        padding: 20px;
    }

    .admin-container {
        padding: 15px;
        margin: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .admin-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1;
        min-width: 120px;
    }

    .user-grid,
    .image-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    input[type="text"],
    input[type="password"],
    input[type="date"],
    select {
        font-size: 16px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }
}