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

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

.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* --- Login --- */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo h1 {
    font-size: 32px;
    color: #3D4B8F;
    font-weight: 700;
}

.login-logo p {
    color: #888;
    margin-top: 8px;
    font-size: 16px;
}

#login-form {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#login-form input {
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#login-form input:focus {
    border-color: #3D4B8F;
}

#login-btn {
    padding: 14px;
    background: #3D4B8F;
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#login-btn:hover {
    opacity: 0.9;
}

#login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-text {
    color: #e53935;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #3D4B8F;
    color: white;
    flex-wrap: wrap;
    gap: 8px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-btn {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.25);
}

.nav-btn.active {
    background: white;
    color: #3D4B8F;
    font-weight: 600;
}

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* --- Stats Bar --- */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #eee;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #3D4B8F;
}

.stat-green {
    color: #43a047 !important;
}

.stat-red {
    color: #e53935 !important;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Verify All Bar --- */
.verify-all-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: 16px;
    margin-bottom: 16px;
}

.verify-all-bar span {
    font-size: 14px;
    font-weight: 500;
    color: #2e7d32;
}

.btn-verify-all {
    background: #43a047;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-verify-all:hover {
    opacity: 0.9;
}

.btn-verify-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Verification Card --- */
#verification-container {
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 24px;
    color: #3D4B8F;
}

.user-phone {
    color: #888;
    margin-top: 4px;
}

.submission-date {
    color: #aaa;
    font-size: 13px;
    margin-top: 4px;
}

/* --- Photos Grid --- */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.photo-item {
    text-align: center;
}

.photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    background: #eee;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo:hover {
    transform: scale(1.03);
}

.photo-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    gap: 16px;
}

.btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-verify {
    background: #43a047;
    color: white;
}

.btn-reject {
    background: #e53935;
    color: white;
}

.btn-refresh {
    background: #3D4B8F;
    color: white;
    width: auto;
    flex: none;
    padding: 12px 32px;
    margin-top: 16px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: #e8f5e9;
    color: #43a047;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
}

.empty-state h2 {
    color: #3D4B8F;
    margin-bottom: 8px;
}

.empty-state p {
    color: #888;
}

/* --- Loading --- */
.loading-state {
    text-align: center;
    padding: 60px 24px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #3D4B8F;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: #888;
}

/* --- Photo Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
}

/* --- Confirm Modal --- */
.confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    cursor: default;
}

.confirm-dialog h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 12px;
}

.confirm-dialog p {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.btn-cancel-modal {
    background: #eee;
    color: #666;
}

.btn-confirm-ok {
    background: #3D4B8F;
    color: white;
}

/* --- History --- */
.history-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.history-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #3D4B8F;
    color: #3D4B8F;
}

.filter-btn.active {
    background: #3D4B8F;
    color: white;
    border-color: #3D4B8F;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.history-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    cursor: pointer;
    flex-shrink: 0;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.history-phone {
    color: #888;
    font-size: 12px;
}

.history-date {
    color: #aaa;
    font-size: 11px;
}

.history-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    flex-shrink: 0;
}

.status-verified {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-rejected {
    background: #ffebee;
    color: #c62828;
}

/* --- Options --- */
.options-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.options-section {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.options-section h3 {
    font-size: 18px;
    color: #3D4B8F;
    margin-bottom: 16px;
    font-weight: 600;
}

.options-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.options-form input {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.options-form input:focus {
    border-color: #3D4B8F;
}

.btn-save {
    background: #3D4B8F;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    flex: none;
}

.btn-save:hover {
    opacity: 0.9;
}

.form-msg {
    text-align: center;
    font-size: 13px;
    min-height: 18px;
}

.form-msg-error {
    color: #e53935;
}

.form-msg-success {
    color: #43a047;
}

/* --- Members List --- */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.member-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.member-email {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.member-date {
    font-size: 11px;
    color: #aaa;
}

.member-you {
    font-size: 12px;
    color: #3D4B8F;
    font-weight: 600;
    padding: 4px 12px;
    background: #e8eaf6;
    border-radius: 12px;
}

.btn-remove-member {
    background: none;
    border: 1px solid #e53935;
    color: #e53935;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-member:hover {
    background: #e53935;
    color: white;
}

/* --- Firmware tab --- */
.form-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.firmware-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.firmware-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    background: #fafafa;
}

.firmware-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.firmware-item-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.firmware-item-notes {
    font-size: 13px;
    background: white;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.firmware-item-actions {
    display: flex;
    gap: 8px;
}

.firmware-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.firmware-status.published {
    background: #4caf50;
    color: white;
}

.firmware-status.draft {
    background: #ff9800;
    color: white;
}

.firmware-status.mandatory {
    background: #f44336;
    color: white;
}

.error-text {
    color: #e53935;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .header h1 {
        font-size: 16px;
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stat-number {
        font-size: 22px;
    }

    #verification-container,
    .history-container,
    .options-container {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }

    .photos-grid {
        gap: 8px;
    }
}
